<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<html>
	<head>
		<title>封条管理及验证系统--加封业务单</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	</head>
<%@ include file="/comm.jsp"%>
<link rel="stylesheet"
		href="http://a.tbcdn.cn/apps/sell/1.0/publish_detail_ke.css?t=20110128editor.css" />
	<script>
		var checkSeqFlag=true;
		function checkValid(txtSeq){
			var seqId=txtSeq.value;
			if(seqId==""){
				$d("seqIdError").innerHTML="请输入封条号码";
				return;
			}
			var params = {
					seqId:seqId
					};
			$.ajax({type: "POST",
			       url: "ajax_findValid",
			       data: params,
			       async: false,   
			       success: function(responseMsg){
			         var result=eval('('+responseMsg+')');
					 var validate=result.validate;
					 if(validate != null){
					  	var status=validate.status;
					  	if(result.retcode == "0000"){
					  		seqIdError.innerHTML="";
					  		checkSeqFlag=true;
					  	}else{
					  		checkSeqFlag=false;
					  		seqIdError.innerHTML=result.retmsg;
					  	}
					 }else{
					 	checkSeqFlag=false;
					 	seqIdError.innerHTML="封条不存在";
					 }
				  }
				},"json");
		}
		
		function previewImage(vSpanId,fileId){
		  	var imgName=vSpanId;
		  	var imgId=$d(fileId).value;
		  	$(imgName).html('');   
			    var newPreview =$(imgName)[0];     
				var imgDiv = document.createElement("div");
				document.body.appendChild(imgDiv);
				imgDiv.style.width = "100%";
		        imgDiv.style.height = "100%";   
		        imgDiv.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod = scale)";      
		        imgDiv.filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = imgId;
				newPreview.appendChild(imgDiv);	
		  }
		 
		 function checkSubmit(){
			if(checkSeqFlag==false){
				alert("该封条不可用，请输入其他封条号码");
				return false;
			}
			return true;
		}
	
	</script>
	
	<style type="text/css">
	<!--
	fieldset {
	    padding:10px;
	    margin:10px;
	    width:270px;
	    color:#333; 
	} 
	legend {
	    color:#06c;
	    font-weight:800; 
	} 
	-->
	</style>

	<body leftmargin="0" topmargin="0" marginheight="0">
		<s:form name="formpage" action="busiInfo_enseal" namespace="/seal"
			method="POST" enctype="multipart/form-data">
			<%@ include file="/messages.jsp"%>
			<s:hidden name="busiInfo.busiNo" value="%{#request.busiInfo.busiNo}"/>
			<s:hidden name="op" value="%{#request.op}"/>
			<div align="left">
				<s:if test="#request.op==1"> <!-- enseal start -->
					<table width="830" border="0">
						<tr>
							<td colspan="2">
								<strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;加封业务单</strong>
							</td>
						</tr>
						<tr>
							<td align="right" width="124">
								<label for="curSeqId">
									封条号：
								</label>
							</td>
							<td>
								&nbsp;<input name="busiOper.seqId" id="curSeqId" type="text" size="30"
									onblur="checkValid(this);" />
								<span id="seqIdError"></span>
							</td>
						</tr>
						<tr>
							<td align="right" valign="top">
								<label for="operInfo">
									备&nbsp;&nbsp;&nbsp;注：
								</label>
							</td>
							<td>
								<textarea id="operInfo" name="busiOper.operInfo" rows="5"
									cols="59">${busiOper.operInfo }</textarea>
							</td>
						</tr>
						<tr>
							<td align="right" valign="top">
								上传图片：
							</td>
							<td>
								<table align="left" width="600">
									<tr>
										<td>
											<div>
												<span> <!-- 
										<div style="position: absolute; right: 35px; color: #f60;">
											上传1200px*1200px以上的图片，即可在宝贝详情页面提供图片放大功能
										</div>
										 -->
													<div id="J_UploadPicTab" class="upload-manager upload-pic">
														<ul class="tabs">
															<li class="selected">
																<span><a href="#" title=""
																	class="J_DetectTrigger">上传图片</a> </span>
															</li>
														</ul>
														<div class="panel panel-local">
															<div class="pic-manager">
																<div class="side">
																	<div></div>
																	<ul>
																		<li class="s1">
																			<a href="javascript:;">d1</a>
																		</li>
																		<li class="s2">
																			<a href="javascript:;">d2</a>
																		</li>
																		<li class="s3">
																			<a href="javascript:;">d3</a>
																		</li>
																		<li class="s4">
																			<a href="javascript:;">d4</a>
																		</li>
																		<li class="s5">
																			<a href="javascript:;">d5</a>
																		</li>
																	</ul>
																</div>
																<div class="main">
																	<input type="hidden" class="J_FirstPicField" />
																	<ul id="J_PanelLocalList">
																		<li>

																			<input type="hidden" class="J_PicUrl" name="picUrl1"
																				id="picUrl1" value="" />
																			<input name="image_pos" type="hidden" value="1" />
																			<span class="preview" id="preview1"></span>
																			<span class="upload"><a href="javascript:;">
																					<s:file name="myfile" id="myfile1"
																						onchange="previewImage('#preview1','myfile1');" />
																			</a> </span>
																			<span class="act"> <span class="moveleft">左移</span>
																				<span class="moveright">右移</span> <span class="del">删除</span>

																			</span>
																		</li>
																		<li>
																			<input type="hidden" class="J_PicUrl" name="picUrl2"
																				value="" />
																			<input name="image_pos" type="hidden" value="2" />
																			<span class="preview" id="preview2"></span>
																			<span class="upload"><a href="javascript:;">
																					<s:file name="myfile" id="myfile2"
																						onchange="previewImage('#preview2','myfile2');" />
																			</a> </span>
																			<span class="act"> <span class="moveleft">左移</span>

																				<span class="moveright">右移</span> <span class="del">删除</span>
																			</span>
																		</li>
																		<li>
																			<input type="hidden" class="J_PicUrl" name="picUrl3"
																				value="" />
																			<input name="image_pos" type="hidden" value="3" />
																			<span class="preview" id="preview3"></span>
																			<span class="upload"><a href="javascript:;">
																					<s:file name="myfile" id="myfile3"
																						onchange="previewImage('#preview3','myfile3');" />
																			</a> </span>

																			<span class="act"> <span class="moveleft">左移</span>
																				<span class="moveright">右移</span> <span class="del">删除</span>
																			</span>
																		</li>
																		<li>
																			<input type="hidden" class="J_PicUrl" name="picUrl4"
																				value="" />
																			<input name="image_pos" type="hidden" value="4" />
																			<span class="preview" id="preview4"></span>
																			<span class="upload"><a href="javascript:;">
																					<s:file name="myfile" id="myfile4"
																						onchange="previewImage('#preview4','myfile4');" />
																			</a> </span>
																			<span class="act"> <span class="moveleft">左移</span>
																				<span class="moveright">右移</span> <span class="del">删除</span>

																			</span>
																		</li>
																		<li>
																			<input type="hidden" class="J_PicUrl" name="picUrl5"
																				value="" />
																			<input name="image_pos" type="hidden" value="5" />
																			<span class="preview" id="preview5"></span>
																			<span class="upload"><a href="javascript:;">
																					<s:file name="myfile" id="myfile5"
																						onchange="previewImage('#preview5','myfile5');" />
																			</a> </span>
																			<span class="act"> <span class="moveleft">左移</span>

																				<span class="moveright">右移</span> <span class="del">删除</span>
																			</span>
																		</li>
																	</ul>
																</div>
															</div>
															<BR>
															<div class="msg">
																<span class="tips"> 您的图片空间剩余容量为<font color="red">200M</font>。
																	单个图片大小不能超过500K </span>
															</div>
														</div>
													</div> </span>
											</div>
										</td>
									</tr>
								</table>
							</td>
						</tr>
						<tr>
							<td colspan="2" align="center">
								<input type="button" class="button" id="save" value=" 保 存 " onclick="checkSubmit();" />
								<input type="button" class="button" id="back" value=" 返 回 "
									onclick="javascript:history.go(-1)" />
							</td>
						</tr>
					</table>
				</s:if><!-- end enseal -->
				
			   <%@ include file="viewBusiness.jsp"%>
				<s:if test="#request.op==0">
					<br />
					<input type="button" class="button" id="back" value=" 返 回 " onclick="javascript:history.go(-1)" />
				</s:if>
				
			</div>
		</s:form>
	</body>
</html>